package com.zjw.zy.utils;


import java.util.Collection;
import java.util.Map;

/**
 * @author ：zhong.jw
 * @date ：Created in 2022/9/28 10:29
 */
public final class CollectionUtils {

    public static boolean isEmpty(Object c) {
        if (c == null) {
            return true;
        }
        if (c instanceof Collection) {
            Collection<?> c1 = (Collection<?>) c;
            return c1.isEmpty();
        }

        if (c instanceof Map) {
            Map<?, ?> c1 = (Map<?, ?>) c;
            return c1.isEmpty();
        }
        return false;
    }


    public static boolean isNotEmpty(Object c) {
        return !isEmpty(c);
    }
}
